import React from 'react'
import { Image, View } from '@tarojs/components';
import Images from '@ASSET/Images'
import './ClearButton.scss'

const ClearButton = ({
  value = '', onClear, style
}) => (value.length > 0 ? (
  <View className="clear-button" onClick={onClear}>
    <Image src={Images.input_clear} className="clear-image" style={style} />
  </View>
) : null)

export default ClearButton
